﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace AutoCreateCodePlus
{
    public static class HttpHelper
    {

       // public static string localhost = "";
       public static string localhost = "";
        /// <summary>
        /// get请求--通过代理发送请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="postStr"></param>
        public static string HttpGetAsyncByProxy(string HttpUrl)
        {
            var webClient = new WebClient { Encoding = Encoding.UTF8 };
            //WebProxy WP = SetProxy();
            //webClient.Proxy = WP;//将代理赋值给HttpWebRequest的Proxy属性    
            webClient.Headers.Add("Content-Type", "application/json;charset=utf-8");

            string json = webClient.DownloadString(HttpUrl);
            return json;
        }
    }
}
